﻿#include "QlyAVStream.h"

QlyAVStream::QlyAVStream(AVStream *stream, int inStreamIndex, int outStreamIndex)
{
    m_stream = stream;
    m_inStreamIndex = inStreamIndex;
    m_outStreamIndex = outStreamIndex;
}

double QlyAVStream::frameRate()
{
    if(!m_stream)
    {
        return -1.0;
    }
    return av_q2d(m_stream->avg_frame_rate);
}

void QlyAVStream::setTimebase(AVRational timebase)
{
    m_stream->time_base.den = timebase.den;
    m_stream->time_base.num = timebase.num;
}

void QlyAVStream::setFrameRate(AVRational frameRate)
{

}

QlyAVStream::QlyAVStream(const QlyAVStream &source)
{
    m_stream = source.m_stream;
    m_inStreamIndex = source.m_inStreamIndex;
    m_outStreamIndex = source.m_outStreamIndex;
}

QlyAVStream & QlyAVStream::operator= (const QlyAVStream & source)
{
    m_stream = source.m_stream;
    m_inStreamIndex = source.m_inStreamIndex;
    m_outStreamIndex = source.m_outStreamIndex;
    return (*this);
}
